import { registerClass } from "../../../cfw/tools/class_decorator";
import BaseLogin from "../../core/login/BaseLogin";
import { DataCallback, ResultCallback, ResultState } from "../../SDKDefine";

@registerClass('MiMoLogin')
export default class MiMoLogin extends BaseLogin {
    checkSession(callback: ResultCallback): void {
    }
    getUserInfo(withCredentials: string, lang: string, func: DataCallback): void {
    }
    logout(): void {
    }
    showUserAgreement(func: ResultCallback): void {
    }

    login(account: string, func: DataCallback) {
        this.sdk.login({
            account: account,
            success(res: any) {
                console.log(`login调用成功${res.code} ${res.anonymousCode}`);
                func(ResultState.YES, res)
            },
            fail(res: any) {
                // console.log(`login调用失败`);
                func(ResultState.NO, null)

            }
        });

    }
}